class Code {
	String title
	String codeString
	String language
	Date submitedDate = new Date()
	
	def beforeInsert = {
		submitedDate = new Date()
   	}
   	def beforeUpdate = {
		submitedDate = new Date()
	}
	
  	static constraints = {
      	title (nullable: false, blank: false, size:5..100)
      	codeString (nullable: false, blank: false, widget: 'textarea', size:1..100000)
      	language (nullable: false, inList:["C++", "C#", "Css", "Delphi", "Groovy", "Java", "Xml", "Java Script", "PHP", "Python", "Ruby", "Sql", "VB"])
      	submitedDate (nullable: false)
  	}
	
}
